﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditNewsMaterialItem.aspx.cs" Inherits="ZLCMS.Web.SystemManage.Weixin.EditNewsMaterialItem"  ValidateRequest="False" %>

<%@ Import Namespace ="ZLCMS.Business.Util" %>
<%@ Register src="~/SystemManage/Control/JFileControl.ascx" tagname="JFileControl" tagprefix="jfc" %>

<form id="pageForm" method="post" runat="Server" class="pageForm required-validate"
    onsubmit="return validateCallback(this, dialogAjaxDone);" action="/SystemManage/Weixin/Material/EditNewsMaterialItem.aspx">

<div class="pageContent">
    <div class="pageFormContent" layoutH="56">
        <dl class="nowrap">
            <dt>标题：</dt>
            <dd><asp:TextBox ID="tb_name" Width="400px" runat="server"></asp:TextBox></dd>
        </dl>
        <dl class="nowrap">
            <dt>描述：</dt>
            <dd><asp:TextBox ID="tb_content" Width="400px" runat="server" TextMode="MultiLine" Rows="3"></asp:TextBox></dd>
        </dl>
        <dl class="nowrap">
            <dt>图片链接：</dt>
            <dd>（支持JPG、PNG格式，较好的效果为大图640*320，小图80*80）</dd>
        </dl>
        <dl class="nowrap">
            <dt>&nbsp;</dt>
            <dd><jfc:JFileControl ID="fc_pic" runat="server" FileCountLimit="1" FileFilters="*.jpg;*.jpeg;*.bmp;*.png;*.gif" FileDesc="图片"/></dd>
        </dl>
        <dl class="nowrap">
            <dt>排序：</dt>
            <dd><asp:TextBox ID="tb_order" runat="server">0</asp:TextBox>&nbsp;（数字越小排序越靠前）</dd>
        </dl>
        <dl class="nowrap">
            <dt>内容类型：</dt>
            <dd>
                <asp:dropdownlist ID="ddl_type" runat="server" onchange="onChangeValue()" style="width:150px">
                    <asp:ListItem Value="URL">超链接</asp:ListItem>
                    <asp:ListItem Value="DOC">文本</asp:ListItem>
                </asp:dropdownlist>
            </dd>
        </dl>
        <dl class="nowrap urlfield" <%= _newsDb.ContentType == "URL" ? "" : "style='display: none;'" %>>
            <dt>跳转链接：</dt>
            <dd><asp:TextBox ID="tb_url" Width="300px" runat="server"></asp:TextBox>             
        <span style="color:red">若为外部链接，则必须以http:// 开头</span>
            </dd>
        </dl>
        <dl>
        <dt>&nbsp;</dt>
        <dd>           
            <a class="button" height="400" width="500" minable="false" maxable="false" mask="true" max="false" title="微网站链接" rel="ShowPageListDialog" target="dialog" href="/SystemManage/Template/Web/ShowPageListDialog.aspx">
                <span>查看微网站链接</span>
            </a>
        </dd>
        </dl>
        <dl class="nowrap matfield" <%= _newsDb.ContentType == "DOC" ? "" : "style='display: none;'" %>>
            <dt>文本内容：</dt>
            <dd>
                <textarea class="editor" name="txtContent" rows="15" cols="75" style="width: 100%; height:100px" id="txtContent" runat="Server"
                    uplinkurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=zip,rar,txt" uplinkext="zip,rar,txt"
                    upimgurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=jpg,jpeg,gif,png" upimgext="jpg,jpeg,gif,png"
                    upflashurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=swf" upflashext="swf"
                    upmediaurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=avi" upmediaext="avi">
                </textarea>
            </dd>
        </dl>
	</div>
	
    <div class="formBar">
		<ul>
            <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
			<li>
				<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
			</li>
		</ul>
	</div>
</div>

<script type="text/javascript">
    function onChangeValue() {
        var val = $('#<%= ddl_type.ClientID %>', $.pdialog.getCurrent()).val();

        if (val == 'DOC') {
            $('.urlfield', $.pdialog.getCurrent()).show();
            $('.matfield', $.pdialog.getCurrent()).show();
            if (itemVal) {
                $('#matfield', $.pdialog.getCurrent()).val(itemVal);
            }
        } else if (val == 'URL') {
            $('.urlfield', $.pdialog.getCurrent()).show();
            $('.matfield', $.pdialog.getCurrent()).hide();
            if (itemVal) {
                $('#urlfield', $.pdialog.getCurrent()).val(itemVal);
            }
        } else {
            $('.urlfield', $.pdialog.getCurrent()).hide();
            $('.matfield', $.pdialog.getCurrent()).hide();
        }
    }
</script>
</form>

